<!--
 * @description  : 卷烟基础信息
 * @descriptionDetail: 卷烟基础信息
 * @copyright    : 浙江烟草
 * @author       : lt
 * @create       : 2022-12-26 08:04:41
-->
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      :title="navTitle"
      :custom-back="goBack"
      style="z-index: 99999"
    >
    </theme-navbar>
    <!-- #endif -->  
    <u-card
      margin="20rpx"
      thumb="../../../../static/check/pending-approval.png"
      thumb-width="38"
      box-shadow="#e5e5e5 0px 0px 50px"
      :show-head="false"
      :show-foot="false"
    >      
      <template #body> 
        <u-form :model="formData"> 
          <div style="float:left;margin-left:24px;">
            <u-image style="width:25px;height:25px;" src="../../../static/cigar/icon_yc.png"></u-image>
          </div> 
          <div style="float:left;margin-left:10px;"> 
            <view style="margin-bottom:15px;">
              <p style="font-size:20px;font-weight:bold;color:#333333;text-align:left;">
                {{ formData.productName }}
              </p>               
            </view>
          </div>        
        </u-form>        
      </template>       
    </u-card> 
    <u-card
      margin="20rpx"
      thumb="../../../../static/check/pending-approval.png"
      thumb-width="38"
      box-shadow="#e5e5e5 0px 0px 50px"
      :show-head="false"
      :show-foot="false"
    > 
      <template #body>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              品牌名称
            </div>
            <div class="top-right">
              厂家
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.productName }}
            </div>
            <div class="middle-right">
              {{ formData.supplyName }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>  
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              货源属性
            </div>
            <div class="top-right">
              价类
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.supplyFullyName }}
            </div>
            <div class="middle-right">
              {{ formData.priceTypeName }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              批发价
            </div>
            <div class="top-right">
              零售指导价
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.wholeSalePrice }}
            </div>
            <div class="middle-right">
              {{ formData.retailPrice }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              是否常销烟
            </div>
            <div class="top-right">
              是否进口烟
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.isOfftenStatus }}
            </div>
            <div class="middle-right">
              {{ formData.importFlagStatus }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              是否骨干品牌
            </div>
            <div class="top-right">
              是否名优烟
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.isMainProductStatus }}
            </div>
            <div class="middle-right">
              {{ formData.isFamousStatus }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              是否省内烟
            </div>
            <div class="top-right">
              是否细支烟
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.isProvinceStatus }}
            </div>
            <div class="middle-right">
              {{ formData.isTinyStatus }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              上市时间
            </div>
            <div class="top-right">
              包条形码
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.saleBeginDate }}
            </div>
            <div class="middle-right">
              {{ formData.packCode }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
        <view>
          <div style="margin-bottom:2px;margin-top: 24px;">
            <div class="top-left" style="float:left;">
              条条行码
            </div>
            <div class="top-right">
              件条形码
            </div>
          </div>
          <div style="margin-bottom:4px;">
            <div class="middle-left" style="float:left;">
              {{ formData.stripCode }}
            </div>
            <div class="middle-right">
              {{ formData.partCode }}
            </div>
          </div>
          <div>
            <u-line color="#D9D9D9" length="100%" :hair-line="false"></u-line>
          </div>
        </view>
      </template>
    </u-card>     
  </view> 
</template>
<script>
import cigarService from "@/service/internal/cigar.service.js";
export default {
  components:{},
  data() {
    return { 
      formData: { 
        productUuid: '',
        orgUuid: '',
      },
    };
  },
  onReady() {
    // this.$refs.uForm.setRules(this.rules);
  },
  onLoad(obj) {
    this.formData.productUuid = obj.productUuid;
    this.formData.orgUuid = this.$storage.get(this.$rp.common.USER).user.org.orgUuid;
    return new Promise(resolve => {
      cigarService.selectProductDetail(this.formData).then((res) => {
        if(res.success){
          this.formData = res.bean;
        }else{
          this.$u.toast(res.msg);
        } 
      }).catch((error) => {
        this.$u.toast(error);
      });       
    });
  },
  // 页面加载成功后也要设置一次，用于处理本页面刷新后失效问题
  mounted() {   
  },
  created () {
    console.log(this.$toast);
  },
  methods: {
  },
};
</script>
<style lang="scss" scoped>
@import "@/style/common/rightMenu.scss";
    .wrap {
        padding: 32px;
    }
    .demo-layout {
        height: 25px;
        border-radius: 4px;
    }

    .bg-purple {
        background: #CED7E1;
        padding: 32px;
        margin: 30px;
    }

    .bg-purple-dark {
        background: #99a9bf;
    }
    p{
      text-align: center;
    }
    .tableView {
      min-height: 0px;
    }
    .top-left{
      width: 40%;
      height: 20px;
      font-size: 14px;
      font-family: ".PingFang SC";
      font-weight: 400;
      color: #666666;
      opacity: 1;
      margin-left: 14px;
    }
    .top-right{
      height: 20px;
      font-size: 14px;
      font-family: ".PingFang SC";
      font-weight: 400;
      color: #666666;
      opacity: 1;
    }
    .middle-left{
      width: 40%;
      height: 27px;
      font-size: 14px;
      font-family: ".PingFang SC";
      font-weight: 500;
      color: black;
      opacity: 1;
      margin-left: 14px;      
    }
    .middle-right{
      height: 27px;
      font-size: 14px;
      font-family: ".PingFang SC";
      color: black;
      opacity: 1;
    }
</style>